local ClientOHOH = _G.ClientOHOH;
local M = ClientOHOH.class.new(script, ClientOHOH.files.Client_PlayerComponent(),script.Parent.Name);
local CallBackManager = ClientOHOH.load.CallBackManager();
local UIManager = ClientOHOH.load.UIManager();
local HomeGui=UIManager.ui_list.HomeGui
local GlobalTipGui=UIManager.ui_list.GlobalTipGui
local LanguageHelper=_G.LanguageHelper 
local FunctionList = ClientOHOH.load.FunctionList();
local PlayerInfoHelper=_G.ClientOHOH.load.PlayerInfoHelper()
local Tool=require(script.Parent.tool)
function M.new(self,...)
	return M(self,...);
end;


function M.ctor(self, parent)
	M.super.ctor(self, parent);	
    
    self.player = self.parent
    self.userId=self.parent:GetUserId()

    self.parent.LeaveHomeEvent:Connect(function()
        print("————————————————离开房间 客户端————————————————————")
         return self:Invoke(FunctionList.refresh_car,true);
    end)
    
    self.UserDataEventConnect=self.parent.UserDataEvent:Connect(function(data)
        -- 调用顺序不可更改
		if data["car"] then
        --更新服务器车辆呈现
            self:Invoke(FunctionList.refresh_car,false);
		end
	end)

    PlayerInfoHelper.GetPlayerInfo(self.userId,function(head,name)
       self:Invoke(FunctionList.info_show,head,name);
    end)
end;


function M.dtor(self)
	M.super.dtor(self);
end;

return M